#!/usr/bin/env bash
source .husky/_base

# 格式化脚本
function formatCode() {
    echo -e '\033[1;32m正在执行暂存区文件语法检测与格式处理~\033[0m'
    if $HAS_PNPM; then
        pnpm exec lint-staged
    else
        npx --no-install lint-staged
    fi
}

function main() {
    formatCode "$@"
}

execute main "$@"
